<template>
  <div class="detection">
    <v-table class="Table" :header="header" :tableList="tableData"></v-table>
    <v-pagination :total="total" @currentPage="currentPage"></v-pagination>
  </div>
</template>

<script>
import vTable from "@/components/Table/index";
import vPagination from "../../components/pagination/index";

export default {
  data() {
    return {
      // departmentlist: [],
      department: "",
      header: [
        {
          prop: "departmentName",
          label: "科室",
        },
        {
          prop: "articleTry",
          label: "试纸批次号",
        },
        {
          prop: "dateInProduced",
          label: "生产日期",
        },
        {
          prop: "liveTime",
          label: "使用日期",
        },
        {
          prop: "qualityControlName",
          label: "名称",
        },
        {
          prop: "qualityMin",
          label: "最小值",
        },
        {
          prop: "qualityMax",
          label: "最大值",
        },
        {
          prop: "detectionValue",
          label: "检测值",
        },
        {
          prop: "detectionStatus",
          label: "结果状态",
        },
        {
          prop: "addTime",
          label: "操作时间",
        },
        {
          prop: "userName",
          label: "操作人",
        },
      ],
      tableData: [],
      total: 10,
    };
  },
  mounted() {
    this.getCheckRecord({});
  },
  methods: {
    delClick(row) {
      console.log(row);
    },
    // 获取检测记录数据
    getCheckRecord(val) {
      let data = {
        departmentId: val && val.departmentId ? val.departmentId : "", //科室ID
        startTime: val && val.startTime ? val.startTime : "", //起始时间
        endTime: val && val.endTime ? val.endTime : "", //结束时间
        current: val && val.current ? val.current : "", //当前页码
      };
      this.$api.getCheckRecord(data).then((res) => {
        this.tableData = res.data.data;
        this.total = res.total;
      });
    },
    currentPage(val) {
      // this.getQualityControl(val)
      this.$parent.search(val)
    },
  },
  components: {
    vTable,
    vPagination,
  },
};
</script>

<style lang="scss" scoped>
.detection {
  .Table {
    margin-top: 30px;
  }
}
</style>